package mapper

import (
	"dlist/issue"
	"dlist/web/domain"
)

func ToBo(vo domain.IssueVo) issue.Issue {
	return issue.Issue{
		Name:     vo.Name,
		Desc:     vo.Desc,
		Priority: vo.Priority,
		Status:   vo.Status,
	}
}

func ToVo(bo issue.Issue) domain.IssueVo {
	return domain.IssueVo{
		ID:       bo.ID,
		Name:     bo.Name,
		Desc:     bo.Desc,
		Priority: bo.Priority,
		Status:   bo.Status,
	}
}

func BatchToVo(list []issue.Issue) []domain.IssueVo {
	result := make([]domain.IssueVo, len(list))
	for i := range list {
		result[i] = ToVo(list[i])
	}
	return result
}
